﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace JsEditor
{
    public partial class TextInputForm : Form
    {
        public TextInputForm()
        {
            InitializeComponent();
        }


        public string BeginInput(string init_text)
        {
            textBox1.Text = init_text;
            textBox1.Select(0, 0);
            var result = ShowDialog();
            while (Visible)
                Application.DoEvents();
            if(result==DialogResult.OK)
                return textBox1.Text;
            return null;
        }

        private void bOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }
    }
}
